using System.Collections.Generic;
using WatiN.Core;

namespace YatFram.Browser.Watin
{
    public class WatinHtmlElement : IHtmlElement
    {
        protected readonly Element element;

        public WatinHtmlElement(Element element)
        {
            this.element = element;
        }

        public void Click()
        {
            element.Click();
        }

        public string Attribute(string attributeName)
        {
            return element.GetAttributeValue(attributeName);
        }

        public IEnumerable<string> ClassNames
        {
            get { return element.ClassName.Split(' '); }
        }

        public object RawElement()
        {
            return element;
        }

        public string Text
        {
            get { return element.Text; }
        }
    }
}